<%-- 
    Document   : password
    Created on : 14.6.2010, 18:40:56
    Author     : kidney
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>ICE HOCKEY MANAGER - Change Password</title>
            <link rel="stylesheet" href="graphics/style.css" media="screen" />
        </head>
        <body>
            <div id="head">
                <h1><h:outputText value="Ice Hockey Manager"/></h1>
            </div>

            <h:form>
                <div id="top-panel">
                    <h:outputText value="#{msgs.logged_in_as}: #{manager.loginName} " />
                    <h:outputText value="(#{msgs.chosen_club}: #{manager.currentClub.name}) " rendered="#{manager.hasClub}" />
                    <h:commandButton value="#{msgs.logout}" action="#{manager.logout}" />
                </div>

                <ul id="menu">
                    <li>
                        <h:commandLink action="#{manager.editTeam}" value="#{msgs.my_team}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.browseOtherTeams}" value="#{msgs.other_teams}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.editOffers}" value="#{msgs.offers}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.editClub}" value="#{msgs.edit}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.editPassword}" value="#{msgs.change_pass}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.clubsList}" value="#{msgs.clubsList}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.createClub}" value="#{msgs.createNewClub}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.createLeague}" value="#{msgs.createNewLeague}" rendered="#{manager.isAdmin}" />
                    </li>
                </ul>
            </h:form>
            <div id="content">
                <div id="in">
                    <h:form prependId="false">
                        <h2><h:outputText value="#{msgs.change_pass}"/></h2>
                        <h:panelGrid columns="2">
                            <h:outputText value="#{msgs.old_pass}" />
                            <h:inputSecret value="#{manager.password}" required="true" requiredMessage="#{msgs.password_required}">
                                <f:validator validatorId="PasswordValidator"/>
                            </h:inputSecret>
                            <h:outputText value="#{msgs.new_pass}" />
                            <h:inputSecret value="#{manager.newPassword}" required="true" requiredMessage="#{msgs.password_required}" />
                        </h:panelGrid>
                        <h:commandButton action="#{manager.changePassword}" value="#{msgs.save}"/>
                        <h:messages />
                    </h:form>
                </div>
            </div>
        </body>
    </html>
</f:view>
